<!--{eval $_TPL['titles'] = array($userinfo['name']."的主页");}-->
<!--{template header_tpl}-->
<div class="grid_16 main_box">
	<!--{if $self}-->
		<div class="headbox">
			<h1>T大爷欢迎您，$userinfo[name]：</h1>
			<div class="grid_16 dayetalk">
				<form action="{SITEURL}home/talk" method="post" accept-charset="utf-8" enctype="multipart/form-data" id="workform">
					<div class="grid_15">
						<textarea name="tdayetalk" id="tdayetalk">说点什么吧</textarea>
					</div>
					<div class="grid_15">
						<!-- <div class="grid_2 alpha tuijian"><a href="#">推荐网址</a></div> -->
						<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
						<div class="grid_4 omega talkbtn"><span class="talkmsg" id="talkmsg">&nbsp;</span><input type="submit" name="talksubmit" value="我说" id="talksubmit" class="talkbtn" disabled /></div>
						<div class="clear"></div>
					</div>
				</form>
			</div>
		</div>
	<!--{/if}-->
	<div class="grid_16 box">
		<h1>动态</h1>
			<!--{if $feeds}-->
				<div class="feed">
					<ul>
					<!--{loop $feeds $value}-->
					<!--{eval $value = mkfeed($value);}-->
					<!--{template feed_li}-->
					<!--{/loop}-->
					</ul>
				</div>
				<div class="footactions">
					<div class="pages">
						{$multi}
					</div>
				</div>
			<!--{else}-->
				<div class="errornotice">还没有关注的人？赶快关注你的朋友吧。</div>
			<!--{/if}-->
	</div>
	<div class="grid_16 box">
		<h1>
			<!--{if $self}-->
				我的作品({$myworks[count]})
			<!--{else}-->
				TA的作品({$myworks[count]})
			<!--{/if}-->
			<span class="more"><a href="{SITEURL}worklist/index/{$userinfo[uid]}">全部</a></span>
		</h1>
		<!--{if $myworks}-->
			<!--{loop $myworks[works] $work}-->
				<div class="workitem">
					<div class="work_thumb">
							<a href="{$work[url]}" title="{$work[title]}"><img src="{$work[thumbimg]}"/></a>
					</div>
				</div>
			<!--{/loop}-->
		<!--{else}-->
			<div class="errornotice">
				还没有上传作品
				<!--{if $self}-->
					<a href="{SITEURL}/imin/index">点击这里上传作品</a>
				<!--{/if}-->
			</div>
		<!--{/if}-->

	</div>
	
</div>
<div class="grid_7 omega sidebar">
	<!--{template userinfo_tpl}-->
	<div class="itembox">
		<h6>
			<!--{if $self}-->
				我关注的人({$followings[count]})
			<!--{else}-->
				他关注的人({$followings[count]})
			<!--{/if}-->
			<span class="more"><a href="{SITEURL}following/index/{$userinfo[uid]}">全部</a></span>
		</h6>
		<!--{if !empty($followings)}-->
				<!--{loop $followings[ship] $following}-->
					<div class="avatar50">
						<a href="{SITEURL}home/index/$following[uid]">
							<img src="{$following[avatar_small]}" title="{$following[name]}"/>
						</a>
					</div>
				<!--{/loop}-->
		<!--{else}-->
			<div class="errornotice">还没有关注的人？赶快关注你的朋友吧。</div>
		<!--{/if}-->
	</div>
</div>
<script src="{SITEURL}resources/js/autoresize.jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('textarea#tdayetalk').autoResize({
	    // On resize:
	    onResize : function() {
	        $(this).css({opacity:0.8});
	    },
	    // After resize:
	    animateCallback : function() {
	        $(this).css({opacity:1});
	    },
	    // Quite slow animation:
	    animateDuration : 1000,
	    // More extra space:
	    extraSpace : 20,

		limit : 600
	});
	
	$('#tdayetalk').focus(function(){
		if ('说点什么吧' == $('#tdayetalk').val()) {
			$('#tdayetalk').val('');
		};
		$('#tdayetalk').css('color', '#333333');
	});
	
	$('#tdayetalk').blur(function(){
		if ('' == $('#tdayetalk').val()) {
			$('#tdayetalk').val('说点什么吧');
			$('#tdayetalk').css('color', '#999999');
		};

	});
	
	$('#tdayetalk').keyup(function() {
		var len = checklen(this, 280);
		len = parseInt(len/2);
		if (len <0) {
			$('#talkmsg').html('<b class="talkmsg error">'+len+'</b>');
			$('#talksubmit').attr("disabled",true);
			$('#talksubmit').css('color', '#999999');
			$('#talkmsg').fadeOut('normal',function() {
				$('#talkmsg').fadeIn('normal');
			});
		}else if(len == 0){
			$('#talkmsg').html('<b class="talkmsg error">'+len+'</b>');
			$('#talksubmit').attr("disabled",true);
			$('#talksubmit').css('color', '#999999');
			$('#talkmsg').fadeOut('normal',function() {
				$('#talkmsg').fadeIn('normal');
			});
		}else{
			$('#talkmsg').html('<b class="talkmsg">'+len+'</b>');
			$('#talksubmit').attr("disabled",false);
			$('#talksubmit').css('color', '#333333');
		};

	});
});

</script>
<!--{template footer_tpl}-->